'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller,jwt } = app;
  const login = app.middleware.login();
  const rush = app.middleware.rush();
  router.get('/', controller.home.index);
  router.post('/sign',controller.user.login.sign);//用户注册
  router.post('/login',controller.user.login.login);//登录
  router.post('/info',login,controller.user.login.changeInfo);//修改信息
  router.get('/info',rush,controller.user.login.getInfo);//获取用户信息
  
  router.get('/video/publisher',controller.user.login.getUserInfoByVideo);//通过视频获取用户信息
  router.get('/videos',rush,controller.video.video.getVideoList);//获取视频列表
  router.get('/video',rush,controller.video.video.getVideo);//获取视频信息
  router.get('/videoClass',rush,controller.video.video.getVideoClass);//获取视频列表
  router.get('/video/recommend',rush,controller.video.video.getVideoRecommend);//获取推荐视频列表
  router.get('/test',rush,controller.video.video.testUp);//获取视频列表

  router.get('/dynamic/my',login,controller.dynamic.getMyDynamic);//获取自己所发布所有帖子
  router.post('/dynamic',login,controller.dynamic.postDynamic);//发布帖子
};
